home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / editor / cedrexx.lha / cedrexx_scripts / CommentStrip.ced < prev    next >
Text File  |  1996-05-07  |  1KB  |  50 lines

  1. /************************************************************\
  2. ** $VER: CommentStrip.ced 1.0                               **
  3. ** By  : James Allen (AKA $LiNg$HoT)                        **
  4. ** Date: April 95'                                          **
  5. ** Rel : May 96'                                            **
  6. ** Description :                                            **
  7. **                                                          **
  8. **     - Strips all of the 'C' style comments from the file.  **
  9. **   - Starts stripping from the current cursor position.   **
  10. **   - Press a key to abort at any time.                    **
  11. **                                                          **
  12. \************************************************************/
  13.  
  14. address 'rexx_ced'
  15.  
  16. OPTIONS RESULTS
  17.  
  18. CEDTOFRONT
  19.  
  20. SEARCH FOR '/*'
  21.  
  22. do while( RESULT ~= 0 )
  23.     found = 1
  24.     IF RESULT ~= 0 then
  25.     Do
  26.         MARK        
  27.         SEARCH FOR '*/'
  28.         RIGHT
  29.         RIGHT
  30.         CUT
  31.     End
  32.  
  33.     /* Allow user to ABORT at any time */
  34.     LASTKEY
  35.     /* Check for a keystroke (~= -1) which is not an key release (< 128) */
  36.     IF (RESULT ~= -1) & (WORD( RESULT, 1 ) < 128) THEN 
  37.     DO
  38.         CEDTOFRONT
  39.         OKAY1 "Comment Strip Aborted!"
  40.         EXIT
  41.     END
  42.     SEARCH FOR '/*'
  43. End
  44.  
  45. If found=1 then
  46.     OKAY1 "Striped Comments.."
  47. Else
  48.     OKAY1 "No comments found!"
  49. Endif
  50.